<template>
	<el-drawer title="房间信息（展示页）" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="房间名称" prop="room">{{form.room}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="房间面积" prop="room_size">{{form.room_size}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="所属楼宇" prop="building_id">{{form.building_id}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="租金定价" prop="rental_pricing">{{form.rental_pricing}}</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="所在楼层/楼宇总层数" prop="floor">{{form.floor}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="物业费" prop="strata_fees">{{form.strata_fees}}</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="所属园区" prop="park_id">{{form.park_id}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="装修状态" prop="renovation_type">{{form.renovation_type}}</el-form-item>
						</el-col>
						<!-- <el-col :lg="12">
							<el-form-item label="所属片区" prop="beginTime">{{form.area_id}}</el-form-item>
						</el-col> -->
						<el-col :lg="12">
							<el-form-item label="招商政策" prop="investment_policy">{{form.investment_policy}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="功能类别" prop="function_type">{{form.function_type}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="是否推荐" prop="recommended">{{form.recommended}}</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="产业定位" prop="industry_positioning">{{form.industry_positioning}}</el-form-item>
					<el-form-item label="空间图片" v-if="form.spatial_pictures!=''">
						<attach-menu :spatial_picture="form.spatial_pictures" :roleFlag="3" :preview="true"></attach-menu>
					</el-form-item>
					<el-form-item label="其他资料">
						<div v-html="form.attachment_upload"></div>
					</el-form-item>
					<el-form-item label="空间介绍" prop="space_introduction">{{form.space_introduction}}</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu
	},
	data() {
		return {
			loading: false,
			form: {
				id:'',
				room:'',
				room_size:'',
				building_id: '',
				rental_pricing: '',
				floor: '',
				strata_fees:"",
				park_id:"",
				renovation_type:'',
				area_id:'',
				investment_policy: '',
				function_type: '',
				recommended:'',
				industry_positioning:'',
				spatial_pictures:'',
				attachment_upload:'',
				space_introduction:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {
		this.getSpaceList();
	},
	methods: {
		//显示
		open(){
			this.visible = true;
			return this;
		},
		async setData(data){
			let res = await this.$API.attractinvestment.park.getParkById.get({id:data.park_id});
			let res1 = await this.$API.attractinvestment.building.getBuildingById.get({id:data.building_id});
			this.form.id = data.id
			this.form.room = data.room
			this.form.room_size = data.room_size
			this.form.building_id = data.building_id
			this.form.rental_pricing = data.rental_pricing
			this.form.floor = data.floor
			this.form.strata_fees = data.strata_fees
			this.form.park_id = data.park_id
			this.form.renovation_type = data.renovation_type
			this.form.area_id = data.area_id
			this.form.investment_policy = data.investment_policy
			this.form.function_type = data.function_type
			this.form.recommended = data.recommended  
			this.form.industry_positioning = data.industry_positioning
			this.form.attachment_upload = data.attachment_upload
			this.form.space_introduction = data.space_introduction
		},
		async getSpaceById(data)
		{
			let res = await this.$API.sattractinvestment.space.getSpaceById.get({spaceId:data});
			{
				if(res.code==200)
				{
					this.form.id = res.data.id
					this.form.room = res.data.room
			        this.form.room_size = res.data.room_size
			        this.form.building_id = res.data.building_id
			        this.form.rental_pricing = res.data.rental_pricing
			        this.form.floor = res.data.floor
			        this.form.strata_fees = res.data.strata_fees
			        this.form.park_id = res.data.park_id
			        this.form.renovation_type = res.data.renovation_type
			        this.form.area_id = res.data.area_id
			        this.form.investment_policy = res.data.investment_policy
			        this.form.function_type = res.data.function_type
			        this.form.recommended = res.data.recommended  
			        this.form.industry_positioning = res.data.industry_positioning
			        this.form.attachment_upload = res.data.attachment_upload
			        this.form.space_introduction = res.data.space_introduction
				}else
				{
					this.$alert(res.message, "提示", {type: 'error'})
				}
			}
		}
	}
}
</script>

<style>
</style>
